package toOffer;

import java.util.Arrays;

/**
 * <h3>leetcode</h3>
 *
 * @author BigFaceCat
 * @date 2024/3/26 17:25
 * @description <p>回文数</p>
 */
public class No9 {
    public static void main(String[] args) {
        int x = -121;
        System.out.println(isPalindrome(x));
    }

    public static boolean isPalindrome(int x) {
        String str = String.valueOf(x);
        StringBuilder sb = new StringBuilder(str);
        String newStr = sb.reverse().toString();
        if (str.equals(newStr)){
            return true;
        }
        return false;
    }
}
